<!DOCTYPE html>
<html>
<head>
<title>定时任务</title>
<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn" style="height:54px;">
			<div class="form-group col-sm-4">
				<input type="text" style="display: inline-block;width: 48%;" class="form-control" v-model="q.beanName" @keyup.enter="query" placeholder="bean名称">
				<input type="text" style="display: inline-block;width: 48%;" class="form-control" v-model="q.remark" @keyup.enter="query" placeholder="备注信息">
			</div>

			<button id="schedule_search" ref="schedule_search" class="btn btn-default" @click="query">查询</button>

			<#if shiro.hasPermission("sys:schedule:save")>
			<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			<a class="btn btn-primary" @click="copy"><i class="fa fa-copy"></i>&nbsp;复制</a>
			</#if>
			<#if shiro.hasPermission("sys:schedule:update")>
			<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("sys:schedule:delete")>
			<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
			<#if shiro.hasPermission("sys:schedule:pause")>
			<a class="btn btn-primary" @click="pause"><i class="fa fa-pause"></i>&nbsp;暂停</a>
			</#if>
			<#if shiro.hasPermission("sys:schedule:resume")>
			<a class="btn btn-primary" @click="resume"><i class="fa fa-play"></i>&nbsp;恢复</a>
			</#if>
			<#if shiro.hasPermission("sys:schedule:run")>
			<a class="btn btn-primary" @click="runOnce"><i class="fa fa-arrow-circle-right"></i>&nbsp;立即执行</a>
			</#if>
			<!--<#if shiro.hasPermission("sys:schedule:log")>-->
				<!--<a class="btn btn-danger" style="float:right;" href="schedule_log.html">日志列表</a>-->
			<!--</#if>-->
		</div>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
	<ul class="layui-tab-title" style="padding: 0 30px;
	transform:translateX(-33%);
    margin-bottom: 15px;
    border-bottom: none;">
		<li lay-id="2" class="layui-this">自动</li>
		<li lay-id="1">手动</li>
	</ul>
</div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
<!--<div class="layui-tab">-->
	<!--<ul class="layui-tab-title">-->
		<!--<li class="layui-this">自动</li>-->
		<!--<li>手动</li>-->
	<!--</ul>-->
	<!--<div class="layui-tab-content">-->
		<!--<div class="layui-tab-item layui-show">-->
			<!--<table id="jqGrid"></table>-->
			<!--<div id="jqGridPager"></div>-->
		<!--</div>-->
		<!--<div class="layui-tab-item">内容2</div>-->
   <!--</div>-->
<!--</div>-->


	</div>
	
	<div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">bean名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="schedule.beanName" :readonly="isReadOnly"  placeholder="spring bean名称，如：testTask"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">方法名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="schedule.methodName"  :readonly="isReadOnly" placeholder="方法名称"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">参数</div>
			   	<div class="col-sm-10">
					<textarea style="height: 120px;resize: none;" type="text" class="form-control" v-model="schedule.params" placeholder="参数"></textarea>

			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">cron表达式</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="schedule.cronExpression" placeholder="如：0 0 12 * * ?"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">备注</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="schedule.remark" placeholder="备注"/>
			    </div>
			</div>
			<div class="form-group" >
				<div class="col-sm-2 control-label">启动模式</div>
				<div class="col-sm-10" id="radios" style="line-height: 35px;">
					<div style="position:relative;display: inline-block;width: 60px;">
						<input id="item1" type="radio" value="2" name="type" value="自动" checked>
						<label for="item1">自动</label>
					</div>
					<div style="position:relative;display: inline-block;width: 60px">
						<input id="item2" type="radio" value="1" name="type" value="手动">
						<label for="item2">手动</label>
					</div>
				</div>
			</div>
			<div class="form-group" v-show="!isReadOnly">
				<div class="col-sm-2 control-label">是否启动</div>
				<div class="col-sm-10" id="radios2" style="line-height: 35px;">
					<div style="position:relative;display: inline-block;width: 60px">
						<input id="item3" type="radio" value="2" name="start" value="启动" checked>
						<label for="item3">启动</label>
					</div>
					<div style="position:relative;display: inline-block;width: 60px">
						<input id="item4" type="radio" value="1" name="start" value="关闭">
						<label for="item4">关闭</label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" ref="schedule_submit" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>

<script src="${request.contextPath}/statics/js/modules/job/schedule.js?_${.now?long}"></script>
<style>
	input[type="radio"] + label::before {
		content: "\a0"; /*不换行空格*/
		display: inline-block;
		vertical-align: middle;
		font-size: 18px;
		width: 1em;
		height: 1em;
		margin-right: .4em;
		border-radius: 50%;
		border: 1px solid #1c84c6;
		text-indent: .15em;
		line-height: 1;
	}
	input[type="radio"]:checked + label::before {
		background-color: #1c84c6;
		background-clip: content-box;
		padding: .2em;
	}
	input[type="radio"] {
		position: absolute;
		clip: rect(0, 0, 0, 0);
	}
	.texts{
		white-space: normal !important;
		height:auto;
		vertical-align:text-top;
		word-break: break-all;
		white-space: pre-line !important;
		overflow: visible !important;
		padding:5px;

	}
</style>
</body>
</html>